January 04, 2025
v3 Send Whatsapp Message
Description:
Send a whatsapp message.
URI:
https://api.multitel.net/v3/wa_send_message
Methods:
POST
Body raw (JSON):
{
"from":"{{Sender-Phone-Number}}",
"to":"{{Recipient-Phone-Number}}",
"template":"{{Template Name or ID}}",
"components": {
"BODY":[
"{{Param 1}}","{{Param 2}}"
]
}
}
Sample Output:
{
"status": {
"code": 200,
"msg": "Success sent message."
},
"response": {
"id": "wamid.4fc462a4c430a0d40db50db1539678c4",
"from": "14503180118",
"to": "15203860195",
"content": "Hello,How are you?",
"category": "SERVICE",
"date": "2025-01-04 07:06:04"
}
}
Sample Code:
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.multitel.net/v3/wa_send_message',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => $json_data,
CURLOPT_HTTPHEADER => array(
'Authorization: Basic YWRtaW46TkxGN01ZQSUNXUVVQUlY0Qw==',
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;